from pathlib import Path

if __name__ == '__main__':
    mol_path = Path('./mols/')
    output_path = Path('.')

    path_strs = []
    for mol_file in mol_path.glob('*.mol2'):
        path_strs.append(f'mols/{mol_file.name}')

    with open(output_path / 'ligands.list', 'w+', encoding='utf-8', newline='\n') as f:
        f.write('\n'.join(path_strs))